<template>
  <view class="index">
    <view class="jtop">
      <view class="status_bar"><!-- 这里是状态栏 --></view>
      <view class="jtop_l" @tap="navigateBack"
        ><image src="../../static/img/ic_back.png"></image
      ></view>
      <view class="jtop_c">所属企业</view>
    </view>
    <view class="tophr"></view>

    <view class="ueb">
      <image
        :src="this.user.corpBaseInfoResponse.logo"
        class="ueb_logo"
        mode="widthFix"
      ></image>
    </view>

    <view class="uebs">
      <view class="uebsb">
        <view class="uebsb_l">
          企业全称
        </view>
        <view class="uebsb_lr uebsb_lr2"
          >{{ this.user.corpBaseInfoResponse.fullName
          }}<image src="../../static/img/user/ic_certificate.png"></image>
        </view>
      </view>
      <view class="uebsb">
        <view class="uebsb_l">
          企业简称
        </view>
        <view class="uebsb_lr">
          {{ this.user.corpBaseInfoResponse.shortName }}
        </view>
      </view>
      <!-- <view class="uebsb noborder">
        <view class="uebsb_l">
          创建人
        </view>
        <view class="uebsb_lr uebsb_lr3">
          {{ jenterprise.creatorName }}
        </view>
      </view> -->
    </view>
  </view>
</template>

<script>
import request from '@/common/request.js';
import { mapState, mapMutations } from 'vuex';

export default {
  computed: {
    ...mapState(['hasLogin', 'forcedLogin']),
  },
  onShow() {
    // uni.getStorageSync('user').corp_id
    var id = uni.getStorageSync('user').corpBaseInfoResponse.id;
    // 获取用户信息
    // request({
    //   url: '/passport/v1/corp/' + id,
    //   method: 'GET',

    //   success: res => {
    //     console.log('企业', res.data.data);

    //     // 已经授权了、查询到用户的数据了
    //     if (res.data.success == true) {
    //       this.jenterprise = res.data.data;
    //     } else {
    //       // 错误
    //       this.repeat_click = true;
    //       uni.showToast({
    //         title: res.data.msg,
    //         icon: 'none',
    //       });
    //     }
    //   },
    // });
  },
  data() {
    return {
      jenterprise: '',
      user: uni.getStorageSync('user'),
    };
  },
  methods: {
    ...mapMutations(['logout']),
    bindLogin() {
      uni.navigateTo({
        url: '../login/login',
      });
    },
    bindLogout() {
      this.logout();
      /**
       * 如果需要强制登录跳转回登录页面
       */
      if (this.forcedLogin) {
        uni.reLaunch({
          url: '../login/login',
        });
      }
    },
    navigateBack() {
      uni.navigateBack();
    },
  },
};
</script>

<style>
.ueb {
  width: 100%;
  height: auto;
  display: block;
  float: left;
  margin: 20rpx 0 0 0;
  border: 1px solid #dddddd;
  border-left: 0;
  border-right: 0;
  background: #ffffff;
}
.ueb_logo {
  width: 304rpx;
  height: auto;
  display: block;
  float: none;
  margin: 20rpx auto 20rpx;
}
.uebs {
  width: 100%;
  height: auto;
  display: block;
  float: left;
  margin: 20rpx 0 0 0;
  border: 1px solid #dddddd;
  border-left: 0;
  border-right: 0;
  background: #ffffff;
}

.uebsb {
  width: 720rpx;
  margin: 0 0 0 30rpx;
  height: 90rpx;
  display: block;
  float: left;
  background: #ffffff;
  border-bottom: 1px solid #dddddd;
}
.uebsb_l {
  width: 150rpx;
  height: auto;
  display: block;
  float: left;
  margin: 24rpx 0;
  font-size: 34rpx;
  color: #000000;
}
.uebsb_lr {
  width: 500rpx;
  height: auto;
  display: block;
  float: right;
  margin: 24rpx 30rpx 0 0;
  font-size: 34rpx;
  color: #000000;
}
.uebsb_lr image {
  width: 36rpx;
  height: 36rpx;
  display: inline-block;
  float: none;
  margin: 0rpx 0 -10rpx 10rpx;
}
.uebsb_lr2 {
  font-size: 28rpx;
  margin-top: 30rpx;
}
.uebsb_lr3 {
  color: #0056ff;
}

.index {
  background: rgb(242, 242, 242);
  width: 100%;
  height: auto;
}
.jtop {
  width: 100%;
  height: 88rpx;
  background: #ffffff;
  position: fixed;
  top: 0;
  left: 0;
  z-index: 1000;
  box-shadow: inset 0px -1px 0px #dddddd;
}
.jtop_l {
  width: auto;
  height: 88rpx;
  display: block;
  float: left;
  font-size: 32rpx;
  color: #000000;
  line-height: 88rpx;
  margin: 0 0 0 30rpx;
}
.jtop_l image {
  width: 48rpx;
  height: 48rpx;
  display: block;
  float: left;
  margin: 20rpx 0 20rpx 0;
}
.jtop_lt {
  margin: 0 0 0 10rpx;
}
.jtop_r {
  width: auto;
  height: 88rpx;
  display: block;
  float: right;
  margin: 0rpx 20rpx 0 0;
  line-height: 88rpx;
  font-size: 32rpx;
  color: #000000;
  color: #256aff;
}
.jtop_rl {
  margin: 20rpx 30rpx 0 0;
}
.jtop_r image {
  width: 48rpx;
  height: 48rpx;
  display: block;
  float: left;
}
.jtop_c {
  width: 70%;
  height: 48rpx;
  line-height: 48rpx;
  display: block;
  float: left;
  position: fixed;
  top: 20rpx;
  left: 15%;
  text-align: center;
  font-size: 36rpx;
  color: #000000;
}
.jtop_c image {
  width: 36rpx;
  height: 36rpx;
  display: inline-block;
  float: none;
  margin-bottom: -5rpx;
  margin-left: 5rpx;
}
.jtop_b {
  width: 100%;
  height: auto;
  background: #ffffff;
  position: fixed;
  top: 88rpx;
  left: 0;
  z-index: 1001;
}
.tophr {
  width: 100%;
  height: 88rpx;
}
</style>
